package cn.meibang.aggragation.common.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cn.apestar.agg.common.security.BaseAuthController;
import cn.apestar.agg.login.third.service.LoginThirdMeiBangService;
import cn.apestar.user.api.UserAPIService;
import cn.apestar.user.provider.info.domain.User;
import cn.meibang.aggragation.meibanguserandclient.controller.MeibangUserAndClientController;

/**
 * 业务管理客 <br>
 * 详细说明.
 * <p>
 * @author yudw
 * @version 1.0
 */
@RestController
@RequestMapping("/meibang")
public class MeibangUserController extends BaseAuthController {

    private Logger logger = LoggerFactory.getLogger(MeibangUserAndClientController.class);

    @Autowired
    private LoginThirdMeiBangService loginThirdMeiBangService;

    @Autowired
    private UserAPIService userAPIService;

    /**
     * 新增业务管理客
     * @param request
     */
    @RequestMapping(value = "/user/info", method = RequestMethod.GET)
    public Object get() {
        logger.debug("获取用户信息开始1~~");
        User use = userAPIService.getByUserId(getCurrentUserId());
        logger.debug("获取用户信息开始2~~");
        logger.debug(Boolean.valueOf(loginThirdMeiBangService == null).toString());
        return loginThirdMeiBangService.getUserInfoByAccount(use.getPhone(), getAppType());
    }

}